'''map 函数'''
li=[1,2,10,20,21,22,23,24]

def func(arg):
       return arg+1
res =map(func,li)
print(res) # --> <map object at 0x000000000113B780>
print(list(res))

print(list(map(lambda li:li+1,li)))


'''filter 筛选函数'''

Li=[1,2,10,20,21,22,23,24]
def func(m):
    if m<10:
        return m
ret=filter(func,Li)
print(list(ret))
print(list(filter(lambda x:x<10,Li)))

'''reduce 函数'''
from functools import reduce
# L0=[1,2,10,20,21,22,23,24]
L0=['a','l','e','x']
def func_add(a,b):
    return a+b
RET = reduce(func_add,L0)
print(RET)

L00=[1,2,10,20,21,22,23,24]
red=reduce(lambda a,b:a+b,L00)
print(red)